package com.pattern.learn.工厂模式;

public class FactoryTest {

    public static void main(String[] args) {
        ShapeFactory shapeFactory = new ShapeFactory();

        Shape shape = shapeFactory.getShape("circle");
        if (shape != null) {
            shape.draw();
        }

        Shape rect = shapeFactory.getShape("rect");
        rect.draw();

        Shape squa = shapeFactory.getShape("squa1");
        squa.draw();
    }
}
